<?php
/**
 * Created by swagger_zxd.
 * User: zxd
 * Date: 2018/2/24
 * Time: 10:33
 */

namespace app\admin\controller;


use think\Controller;

class platform extends Controller
{
    //平台明细记录
    public function platformDetailsRecording()
    {
        if ($this->request->method()=="POST") {
            $data=$this->request->param();
            //结束时间
            if (array_key_exists('begin',$data)) {
                $begin=$data['begin']?"'".$data['begin']."'":'null';
            }else{
                $begin='null';
            }
            //开始时间
            if (array_key_exists('end',$data)) {
                $end=$data['end']?"'".$data['end']."'":'null';
            }else{
                $end='null';
            }
            //
            $page=$data['page']?$data['page']:1;
            $PlatformModel=new \app\admin\model\Platform();
            return $PlatformModel->loadPlatformSummaryData($begin,$end,$page);

        } elseif ($this->request->method()=="GET") {
            return $this->fetch('platformDetailsRecording');
        }
    }


    //平台汇总明细
    public function platformSummaryDetails()
    {
        if ($this->request->method()=="POST") {
            $PlatformModel=new \app\admin\model\Platform();
            return $PlatformModel->loaPlatformSummaryDetails();
        } elseif ($this->request->method()=="GET") {
            return $this->fetch('platformSummaryDetails');
        }
    }

}